import 'package:json_annotation/json_annotation.dart';
part 'room_detail_data.g.dart';

@JsonSerializable()
// 房屋详情数据类
class RoomDetailData {
  // JsonKey表示后端接口返回的字段名
  @JsonKey(name: 'houseCode')
  String? id;// 房源id
  String? title;// 标题
  String? community;// 房源社区
  @JsonKey(name: 'description')
  String? subTitle;//  副标题
  int? size;// 房源面积
  String? floor;// 楼层
  int? price;// 价格
  String? roomType;// 房源类型
  @JsonKey(name: 'houseImg')
  List<String>? houseImgs;//  房屋图片列表
  List<String>? tags;// 房源标签列表
  List<String>? oriented;//  房屋朝向
  @JsonKey(name: 'supporting')
  List<String>? applicances;// 房源设施

  RoomDetailData({
    this.id,
    this.title,
    this.community,
    this.subTitle,
    this.size,
    this.roomType,
    this.houseImgs,
    this.tags,
    this.price,
    this.floor,
    this.oriented,
    this.applicances,
  });

  factory RoomDetailData.fromJson(Map<String, dynamic> json)=>_$RoomDetailDataFromJson(json);
  Map<String, dynamic> toJson()=>_$RoomDetailDataToJson(this);
}